package com.tong.cloud.feign.configure;

import com.tong.cloud.feign.contract.CustomContract;
import feign.Contract;
import feign.Logger;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.cloud.openfeign.AnnotatedParameterProcessor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.List;

@Configuration(proxyBeanMethods = false)
public class CustomFeignConfiguration {


    @Bean
    @ConditionalOnMissingBean
    public Contract feignContract(List<AnnotatedParameterProcessor> parameterProcessors) {
        return new CustomContract(parameterProcessors);
    }

    @Bean
    Logger.Level feignLoggerLevel() {
        return Logger.Level.FULL;
    }


}
